﻿using System;
using System.Collections.Generic;
using System.Linq;
using SuppKids.Core.Domain;
using SuppKids.Licensing.Common;

namespace SuppKids.Core.Reporting.Data
{
	public class ParentsReportData : ReportData
	{
		public ParentsReportData(IEnumerable<DailyMenu> dailyMenus, DayOfWeek dayOfWeek, WeekNumber weekNumber, MenuType menuType, IEnumerable<GroupData> groupsData)
		{
			DailyMenus = dailyMenus;
			DayOfWeek = dayOfWeek;
			WeekNumber = weekNumber;
			MenuType = menuType;
			GroupsData = groupsData
                .OrderByDescending(a => a.Group.Name.ToLowerInvariant() == "ясли")
                .ThenByDescending(a => a.Group.Name.ToLowerInvariant() == "сад")
				.ThenBy(a => a.Group.Name)
				.ToList();
		}

		public IEnumerable<DailyMenu> DailyMenus { get; set; }
		public DayOfWeek DayOfWeek { get; set; }
		public WeekNumber WeekNumber { get; set; }
		public MenuType MenuType { get; set; }
		public List<GroupData> GroupsData { get; set; }
	}
}